import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import About from './views/About.vue'
import my from './views/my.vue'
import record from './views/record.vue'
import withdrawal from './views/withdrawal.vue'
import invitation from './views/invitation.vue'
import bonus from './views/bonus.vue'
import single from './views/single.vue'
import unpaid from './views/unpaid.vue'
import pendingAward from './views/pendingAward.vue'
import openedAward from './views/openedAward.vue'


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      redirect:"/home"
    },
    {
      path: '/home',
      name: 'home',
      component: Home
    },
    {
      path: '/about',
      name: 'about',
      component: About
    },
    {
      path: '/record/:id',
      name: 'record',
      component: record,
      props: true
    },
    {
      path: '/withdrawal',
      name: 'withdrawal',
      component: withdrawal
    },
    {
      path: '/invitation',
      name: 'invitation',
      component: invitation
    },
    {
      path: '/bonus',
      name: 'bonus',
      component: bonus
    },
    {
      path: '/single',
      name: 'single',
      component: single,
      redirect: '/single/unpaid',
      children:[
        {
          path: 'unpaid',
          component: unpaid
        },
        {
          path: 'pendingAward',
          component: pendingAward
        },
        {
          path: 'openedAward',
          component: openedAward
        }
      ]
    },
    {
      path: '/my',
      name: 'my',
      component: my
    }
  ]
})
